<div class="saved-filters">
  <nz-tag 
    *ngFor="let scheme of savedSchemes" 
    [nzColor]="currentScheme?.name === scheme.name ? '#108ee9' : ''"
    (click)="loadScheme(scheme)"
    nzMode="closeable"
    (nzOnClose)="deleteScheme(scheme, $event)">
    {{ scheme.name }}
  </nz-tag>
  <nz-tag *ngIf="!isAdding" (click)="showInput()" class="new-tag">
    <i nz-icon nzType="plus"></i> {{ l('BasicArchives::UI:AdvancedFilterDialog.Button.NewTag') }}
  </nz-tag>
  <input 
    #inputElement
    *ngIf="isAdding"
    nz-input 
    class="tag-input" 
    [nzSize]="'small'"
    [(ngModel)]="schemeName"
    (blur)="handleInputConfirm()"
    (keydown.enter)="handleInputConfirm()"
  >
</div>

<form nz-form [formGroup]="validateForm">
  <filter-group [group]="validateForm" [entityConfig]="entityConfig" (enterKeyPressed)="submitForm()"></filter-group>
</form>

<div class="modal-footer">
  <div class="button-group">
    <button nz-button (click)="cancel()">{{ l('BasicArchives::UI:AdvancedFilterDialog.Button.Cancel') }}</button>
    <button nz-button nzType="primary" (click)="submitForm()">{{ l('BasicArchives::UI:AdvancedFilterDialog.Button.Submit') }}</button>
  </div>
</div>